import 'package:chat_app_project/generated/json/base/json_field.dart';
import 'package:chat_app_project/generated/json/demand_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class DemandEntity {
	late int bids;
	late DemandCircleVo circleVo;
	late String closeTime;
	late int collections;
	late String completeTime;
	late String content;
	late String createTime;
	late int id;
	late List<dynamic> labels;
	late int lat;
	late int likes;
	late int lng;
	late List<dynamic> loc;
	late String location;
	late int memberId;
	late DemandMemberInfo memberInfo;
	late int money;
	late String number;
	late List<String> pics;
	late int realDistance;
	late String releaseTime;
	late String status;
	late String title;
	late String type;
	late String updateTime;
	late List<DemandVideos> videos;
	late int views;

	DemandEntity();

	factory DemandEntity.fromJson(Map<String, dynamic> json) => $DemandEntityFromJson(json);

	Map<String, dynamic> toJson() => $DemandEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DemandCircleVo {
	late int adminId;
	late String createTime;
	late String icon;
	late int id;
	late String intro;
	late int memberId;
	late int memberNum;
	late String name;
	late int sorts;
	late String status;
	late String updateTime;

	DemandCircleVo();

	factory DemandCircleVo.fromJson(Map<String, dynamic> json) => $DemandCircleVoFromJson(json);

	Map<String, dynamic> toJson() => $DemandCircleVoToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DemandMemberInfo {
	late String avatar;
	late int creditScore;
	late int id;
	late String intro;
	late String nickName;

	DemandMemberInfo();

	factory DemandMemberInfo.fromJson(Map<String, dynamic> json) => $DemandMemberInfoFromJson(json);

	Map<String, dynamic> toJson() => $DemandMemberInfoToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class DemandVideos {
	late String cover;
	late String url;

	DemandVideos();

	factory DemandVideos.fromJson(Map<String, dynamic> json) => $DemandVideosFromJson(json);

	Map<String, dynamic> toJson() => $DemandVideosToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}
